//
//  MenuShiLiaoTableViewCell.m
//  Products_B
//
//  Created by lanou on 16/6/7.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "MenuShiLiaoTableViewCell.h"

@implementation MenuShiLiaoTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.picImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kWidth/5 *3 - 10, 100)];
        self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 60, kWidth/5 *3 - 10, 20)];
        self.titleLabel.textColor = [UIColor whiteColor];
        self.titleLabel.font = [UIFont systemFontOfSize:14];
        self.desLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 80, kWidth/5*3 - 10, 20)];
        self.desLabel.font = [UIFont systemFontOfSize:14];
        self.desLabel.textColor = [UIColor grayColor];
        self.playButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.playButton.frame = CGRectMake(kWidth/5 * 3- 10 - 10 - 30 , 60, 30, 30);
        
        self.playButton.backgroundColor = [UIColor magentaColor];
        
        [self.contentView addSubview:_picImageView];
        [self.contentView addSubview:_titleLabel];
        [self.contentView addSubview:_desLabel];
        [self.contentView addSubview:_playButton];
        
        
    }
    return self;
}
- (void)setModel:(MenuShiliaoRightModel *)model{
    _model = model ;
    [self.picImageView sd_setImageWithURL:[NSURL URLWithString:model.image] placeholderImage:nil completed:nil];
    self.titleLabel.text = model.title;
    self.desLabel.text = model.descriptiont;
}
@end
